package 面试相关;

import java.util.*;

public class 质数和 {
    public static  int m = 1,sum = 0,z = 0;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int len = scanner.nextInt();
        int i = 0;
        int[] nums = new int[len];
        while (i < len){
            nums[i] = scanner.nextInt();
            i++;
        }
        for(int p = 1; p <= nums.length; p++){
            getcombine(nums,0,p);
        }
        System.out.println(sum % (Math.pow(10,9) + 7));
    }
    public static void getcombine(int[] nums,int start, int k){//回溯求组合
        if(z == k){
            sum += zhinum(m);
        }
        for(int i = start; i < nums.length; i++){
            m *= nums[i];
            z++;
            getcombine(nums,i + 1,k);
            m /= nums[i];
            z--;
        }
    }
    public static int zhinum(int n){//判断质数和
        int i;
        Set<Integer> set = new HashSet<Integer>();
        i = 2;
        while (i<Math.sqrt(n)+1){
            if (i*i>n){
                set.add(n);
                break;
            }
            if (n%i == 0){
                set.add(i);
                n=n/i;
                i=2;
                continue;
            }
            i++;
        }
        return set.size();
    }
}